<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
</head>
<body>
// 引入jsPDF库
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.3/jspdf.umd.min.js"></script>-->
<!--<script src="https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js"></script>-->
<script>
    // 创建一个新的PDF文档
    // console.log('window', window);
    // console.log('jsPDF', jsPDF);
    var doc = new jsPDF();

    // 添加内容到PDF
    doc.text('Hello World!', 10, 10);

    // 将PDF保存为文件
    doc.save('sample.pdf');
</script>
</body>
</html>